package com.cq.service.impl;

import com.cq.mapper.UserMapper;
import com.cq.pojo.User;
import com.cq.pojo.User_meeting;
import com.cq.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: 悠久的苍穹
 * @Date: 2021/1/22 15:54
 * @Description: ${description}
 * @Version: 1.0
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;

    @Override
    public User findUserByOpenId(String openid, String nickname) {
        return userMapper.findUserByOpenId(openid,nickname);
    }

    @Override
    public int addUser(User user1) {
        return userMapper.addUser(user1);
    }

    @Override
    public int updateUser(User user) {
        return userMapper.updateUser(user);
    }

    @Override
    public List<User> findUsers(int page, int limit) {
        return userMapper.findUsers((page-1)*limit,limit);
    }

    @Override
    public User findUserByUUid(String uuid) {
        return userMapper.findUserByUUid(uuid);
    }

    @Override
    public int updateUserAuth(User user) {
        return userMapper.updateUserAuth(user);
    }

    @Override
    public void deleteUserById(String s1) {
        userMapper.deleteUserById(s1);
    }

    @Override
    public int getCount() {
        return userMapper.getCount();
    }

    @Override
    public User_meeting findUserByUUidAndMeetingId(String userId, String meetingId) {
        return userMapper.findUserByUUidAndMeetingId(userId,meetingId);
    }

    @Override
    public void addUserMeeting(User_meeting user_meeting) {
        userMapper.addUserMeeting(user_meeting);
    }

    @Override
    public int isSign(String meetingId, String uuid) {
        return userMapper.isSign(meetingId,uuid);
    }

    @Override
    public void sign(String meetingId, String uuid) {
        userMapper.sign(meetingId,uuid);
    }

    @Override
    public void updateJoin(String userId, String meetingId) {
        userMapper.updateJoin(userId,meetingId);
    }

    @Override
    public List<User> findUserSign(String sign, String meetingId) {
        return userMapper.findUserSign(sign,meetingId);
    }

    @Override
    public void updateEmail(String uuid, String email) {
        userMapper.updateEmail(uuid,email);
    }
}
